<?php

class Pageley_Gateway_DatabaseTests extends Pageley_Test_Case {
    
    private $dataSource;
    private $database;
    
    public function setUp() {
        $this->dataSource = new Pageley_Gateway_Database_DataSourceMock();
        $this->database = new Pageley_Gateway_Database($this->dataSource);
    }
    
    public function testGetTransaction() {
        $transaction = $this->database->getTransaction();
        $transaction2 = $this->database->getTransaction(true);
        $transaction3 = $this->database->getTransaction(false);
        
        $this->assertSame($transaction, $transaction2);
        $this->assertNotSame($transaction, $transaction3);
    }
}